package com.stone.compose.ui.screen

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.delay

@Composable
fun SplashScreen(toNextSceen:()->Unit) {

    LaunchedEffect(Unit) {
        delay(5000)
        toNextSceen()
    }

    Box(modifier = Modifier
        .background(Color.White)
        .fillMaxHeight()
        .fillMaxWidth(),
        contentAlignment= Alignment.Center
    ) {
        Column {
            Text(text = "Hello compose",modifier = Modifier.size(18.dp))
            Text(text = "my name is stone",modifier = Modifier.size(12.dp))
        }

    }


}